<html>

	<head>
		<title>新增商品价格</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">

		<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
		<link href="../../css/skin/Content/Shop/fonts/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="../../css/dialog.css">
		<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

		<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>

		<script type="text/javascript" src="../../js/lhgdialog/lhgdialog.js?skin=idialog"></script>

		<script src="../../js/lib/ligerUI/js/plugins/ligerPopupEdit.js"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerRadio.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTip.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
		<script src="../../js/lib/jquery.form.js" type="text/javascript"></script>
		<script src="../../js/lib/json2.js" type="text/javascript"></script>
		<script src="../../js/dialog.js"></script>
		<script src="../../js/JS/layout.js"></script>
		<script src="../../js/constants.js" type="text/javascript"></script>
		<script src="../../js/api.js" type="text/javascript"></script>
		<html>
		<script type="text/javascript">
			var data = JSON.parse(unescape($api.getparastr("data")));
		 
			$(function() {
				$("form").ligerForm();
				initContorl();
				initView();
			});

			var popNation;
			function initContorl() {
				var url = BaseUrl + "nation/sql?token=" + $api.getStorage("token");
				$api.ajaxget(url, {}, function(result) {
					popNation = $("#Fnid").ligerComboBox({
						data: result.Rows,
						valueField: 'Fid',
						textField: 'Fname'
					});

					if(!$api.isEmpty(data)) {
						popNation.setValue(data.Fnid);
					} 

				});
			}

			function f_save() {
				if($api.isEmpty(popNation.getValue())) {
					$.ligerDialog.warn('请选择国籍！');
					return null;
				}
				if($api.isEmpty($('#Fcurrency').val())) {
					$.ligerDialog.warn('币种不能为空！');
					return null;
				}
				if($api.isEmpty($('#Fprice').val())) {
					$.ligerDialog.warn('销售价格不能为空！');
					return null;
				} 
			 
				var row = $("form").serializeObject();
				if(data)row.Fid=data.Fid;
				return row;
			} 

			function initView() {   
				if(!$api.isEmpty(data)) {
					$api.loadJsonToForm(data) 
				} 
			}

			 
		</script>
	</head>

	<body>
		<form id="form1" onsubmit="return false">
			<div>

				<div class="div-content">

					<div class="divhead">价格属性</div>
					<hr class="divline" />
					<dl>
						<dt>国别</dt>
						<dd>
							<div style="float:left">
								<input type="text" id="Fnid" name="Fnid" ligerui="{width:120}" validate="{required:true}" />
							</div>

						</dd>
					</dl>
					<dl>
						<dt>所属币种</dt>
						<dd>
							<div style="float:left">
								<input type="text" id="Fcurrency" name="Fcurrency" ltype="text" ligerui="{width:120}" validate="{required:true}" /></div>

						</dd>
					</dl>
					<dl>
						<dt>售价</dt>
						<dd>
							<div style="float: left;">
								<input type="text" value="1" id="Fprice" name="Fprice" ltype="text" ligerui="{number:true,width:120,initSelect:true}" validate="{required:true}" />
							</div>

						</dd>

					</dl>

				</div>
			</div>
		</form>
	</body>

	</html>